﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <script>
        document.write("<script type='text/javascript' src='layuiAdmin/xin.js?v=" + Date.now() + "'><\/script>");
    </script>
    <script src="layuiAdmin/layui/layui.js"></script>
    <script>
        layui.config({
            base: 'layuiAdmin/', //静态资源所在路径
            version: myLop.version
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form'], function () {
            var $ = layui.$,
                setter = layui.setter,
                admin = layui.admin;

            var code = $.getParam("code");
            //登入接口
            admin.req({
                type: 'post',
                url: '/api/Login/QQLogin?code=' + code,
                success: function (res) {
                    if (res.code == 200) {
                        layui.sessionData(setter.tableName, {
                            key: setter.request.tokenName,
                            value: res.data.auth_token.token_type + ' ' + res.data.auth_token.token
                        });
                        layui.sessionData(setter.tableName, {
                            key: 'UserInfo',
                            value: res.data
                        });
                        //登入成功的提示与跳转
                        layer.msg('登入成功', {
                            offset: '15px',
                            icon: 1,
                            time: 1000
                        }, function () {
                            location.href = '/admin/index.html'; //后台主页
                        });
                    } else {
                        layer.msg(res.msg)
                    }
                }
            });
        })
    </script>
</head>
<body>
    登录成功,正在为您跳转！！！！！
</body>
</html>